package pers.vic.rpc.registry;

import pers.vic.rpc.registry.model.RpcUrl;

/**
 * 描述: 注册中心接口
 * @author Vic.xu
 * @date 2022-02-10 15:49
 */
public interface IRegistry {

    /**
     * 注册服务地址
     * @param url
     * @throws Exception
     */
    void register(RpcUrl url) throws Exception;

    /**
     * 取消注册
     * @param url
     * @throws Exception
     */
    void unRegister(RpcUrl url) throws Exception;

    /**
     * 动态发现服务地址
     * @param serverName
     * @return
     * @throws Exception
     */
    RpcUrl discovery(String serverName) throws Exception;
}
